//
//  ViewController.m
//  SimpleController
//
//  Created by dllo on 16/5/11.
//  Copyright © 2016年 jcl. All rights reserved.
//

#import "ViewController.h"
#import "VCOfSecond.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self createSubView];
    [self createNavigationItem];
}


- (void)createSubView {
    
    UIView *viewRed = [[UIView alloc] initWithFrame:self.view.bounds];
    
    [self.view addSubview:viewRed];
    
    viewRed.backgroundColor = [UIColor redColor];
    
    [viewRed release];
    
//    UIScrollView *scroll = [[UIScrollView alloc] initWithFrame:self.view.bounds];
//  
//    [self.view addSubview:scroll];
//    
//    scroll.backgroundColor = [UIColor whiteColor];
//    
//    [scroll release];
    
    
}

- (void)createNavigationItem {
    
    self.navigationItem.title = @"第一页";
    
    
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSearch target:self action:@selector(handleRight:)];
    
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(handleLeft)];
    
    
    
}


- (void)handleRight:(UIBarButtonItem *)barRight {
    
    
    VCOfSecond *vc2 = [[VCOfSecond alloc] init];
    
    [self.navigationController pushViewController:vc2 animated:YES];
    
  
    
}

- (void)handleLeft {
    
    
}






@end
